#include<iostream>
#include<math.h>
using namespace std;
int main() {
	int a, b, c;
	int s[10];
	cin >> a;
	for (int i = 0; i < a; i++) {
		cin >> s[i];
	}
	b = s[0]; c = 0;
	for (int i = 1; i < a; i++) {
		if (b < s[i]) {
			b = s[i];
			c = i;
		}
	}
	cout << b << " " << c;
	return 0;
}